﻿#region Regions

using System;
using System.ComponentModel;

using FMWare.Core.Base;

#endregion

namespace FMWare.Core.Objects
{
	public class Kit : Item
	{
		#region Public Properties

		public Int16 BackColor { get; set; }
		public Int16 ForeColor { get; set; }
		public Int16 Outline { get; set; }
		public KitStyle Style { get; set; }

		[Browsable(false)]
		public Byte[] UnknownData0 { get; set; }

		[Browsable(false)]
		public Byte[] UnknownData1 { get; set; }

		#endregion

		#region Internal Properties

		internal override string ExportData
		{
			get { return Global.CreateDelimitedString(""); }
		}

		#endregion

		#region Internal Methods

		/// <summary>
		/// Reads data with the specified reader.
		/// </summary>
		/// <param name="reader">The reader.</param>
		internal override void Read(BinaryReader reader)
		{
			Reader = reader;
			ForeColor = reader.ReadInt16();
			BackColor = reader.ReadInt16();
			Outline = reader.ReadInt16();
			UnknownData0 = reader.ReadBytes(2);
			UnknownData1 = reader.ReadBytes(2);
			Style = (KitStyle) reader.ReadByte();
		}

		/// <summary>
		/// Writes data with the specified writer.
		/// </summary>
		/// <param name="writer">The writer.</param>
		internal override void Write(BinaryWriter writer)
		{
			Writer = writer;
			writer.Write(ForeColor);
			writer.Write(BackColor);
			writer.Write(Outline);
			writer.Write(UnknownData0);
			writer.Write(UnknownData1);
			writer.Write((Byte) Style);
		}

		#endregion
	}
}